package com.jiuzhou.system.service.impl;

import java.util.List;

import com.jiuzhou.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jiuzhou.system.mapper.SysCustomerPageMapper;
import com.jiuzhou.system.domain.SysCustomerPage;
import com.jiuzhou.system.service.ISysCustomerPageService;

/**
 * 自定义表单Service业务层处理
 *
 * @author jiuzhou
 * @date 2021-08-24
 */
@Service
public class SysCustomerPageServiceImpl implements ISysCustomerPageService {
    @Autowired
    private SysCustomerPageMapper sysCustomerPageMapper;

    /**
     * 查询自定义表单
     *
     * @param id 自定义表单ID
     * @return 自定义表单
     */
    @Override
    public SysCustomerPage selectSysCustomerPageById(Long id) {
        return sysCustomerPageMapper.selectSysCustomerPageById(id);
    }

    /**
     * 查询自定义表单列表
     *
     * @param sysCustomerPage 自定义表单
     * @return 自定义表单
     */
    @Override
    public List<SysCustomerPage> selectSysCustomerPageList(SysCustomerPage sysCustomerPage) {
        return sysCustomerPageMapper.selectSysCustomerPageList(sysCustomerPage);
    }

    /**
     * 新增自定义表单
     *
     * @param sysCustomerPage 自定义表单
     * @return 结果
     */
    @Override
    public int insertSysCustomerPage(SysCustomerPage sysCustomerPage) {
        sysCustomerPage.setCreateTime(DateUtils.getNowDate());
        return sysCustomerPageMapper.insertSysCustomerPage(sysCustomerPage);
    }

    /**
     * 修改自定义表单
     *
     * @param sysCustomerPage 自定义表单
     * @return 结果
     */
    @Override
    public int updateSysCustomerPage(SysCustomerPage sysCustomerPage) {
        sysCustomerPage.setUpdateTime(DateUtils.getNowDate());
        return sysCustomerPageMapper.updateSysCustomerPage(sysCustomerPage);
    }

    /**
     * 批量删除自定义表单
     *
     * @param ids 需要删除的自定义表单ID
     * @return 结果
     */
    @Override
    public int deleteSysCustomerPageByIds(Long[] ids) {
        return sysCustomerPageMapper.deleteSysCustomerPageByIds(ids);
    }

    /**
     * 删除自定义表单信息
     *
     * @param id 自定义表单ID
     * @return 结果
     */
    @Override
    public int deleteSysCustomerPageById(Long id) {
        return sysCustomerPageMapper.deleteSysCustomerPageById(id);
    }
}
